/**
 * tzdesk系统平台
 * moonvip_admin
 * com.tz.service.shopbanner
 * IShopBannerService.java
 * 创建人:小胡 
 * 时间：2017年02月06日 15:49:44
 *
 */
package com.tz.service.shopbanner.impl;

import com.tz.bean.ShopBanner;
import com.tz.bean.TzParams;
import com.tz.dao.shopbanner.IShopBannerMapper;
import com.tz.service.shopbanner.IShopBannerService;
import com.tz.util.TmStringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

/**
 * 商城海报管理serviceImpl
 * IShopBannerService
 * 创建人:小胡 
 * 时间：2017年02月06日 15:49:44
 * @version 1.0.0
 * 
 */
@Service
public class ShopBannerServiceImpl implements IShopBannerService{

	@Autowired
	private IShopBannerMapper shopbannerMapper;
	
	@Override
	public List<ShopBanner> findShopBanners(TzParams params){
		if(TmStringUtils.isEmpty(params.getOrder()))params.setOrder("create_time desc");
		return shopbannerMapper.findShopBanners(params);
	}
	
	@Override
	public int count(TzParams params) {
		return shopbannerMapper.count(params);
	}

	@Override
	public HashMap<String ,Object> getShopBanner(Integer id) {
		return shopbannerMapper.getShopBanner(id);
	}

	@Override
	public int save(ShopBanner shopbanner) {
		return shopbannerMapper.save(shopbanner);
	}

	@Override
	public int update(ShopBanner shopbanner) {
		return shopbannerMapper.update(shopbanner);
	}

	@Override
	public int delete(TzParams params) {
		return shopbannerMapper.delete(params);
	}

}
